<template>
	<view>
		<!-- <u-navbar :is-back="true" :is-fixed="true" title="订单详情"></u-navbar> -->
		<view style=" background-color:#EFEDE9;">
			<view class="pl-3 pr-2 font-14 lineHight-40 font-weight-bold">订单需求</view>
		</view>
		<u-field v-model="newlist.orderStateText" :border-bottom="false" label="订单状态" :disabled="true"
			input-align="right" :field-style="placeholderStyles">
		</u-field>
		<u-field v-model="newlist.downEnterpriseName" :border-bottom="false" label="下游服务商" label-width="140"
			:disabled="true" input-align="right" :field-style="placeholderStyle"></u-field>

		<u-field v-model="newlist.title" :border-bottom="false" :disabled="true" label="需求标题" label-width="140"
			input-align="right" :field-style="placeholderStyle"></u-field>

		<u-field v-model="newlist.productName" :border-bottom="false" :disabled="true" label-width="180" label="产品名称"
			input-align="right" :field-style="placeholderStyle"></u-field>

		<u-field v-model="newlist.downLegalRepresentative" :border-bottom="false" :disabled="true" label="联系人"
			input-align="right" :field-style="placeholderStyle"></u-field>
		<u-field v-model="newlist.downPhone" :border-bottom="false" :disabled="true" label="联系方式" input-align="right"
			:field-style="placeholderStyle"></u-field>
		<!-- <u-field v-model="newlist.number" :border-bottom="false" :disabled="true" label="需求数量" input-align="right"
			:field-style="placeholderStyle"></u-field> -->
		<view class="dfex pl-3 pr-3 lineHight-3">
			<view>需求数量</view>
			<view class="dfel text-999999">
				<view>{{newlist.number}}</view>
				<view>{{newlist.productSpecsText}}</view>
			</view>
		</view>
		<!-- <u-field v-model="newlist.productSpecs" :border-bottom="false"  :disabled="true" label="需求规格" input-align="right"
			:field-style="placeholderStyle"></u-field> -->
		<u-field v-model="newlist.price" :border-bottom="false" :disabled="true" label-width="180" label="需求价格(元)"
			input-align="right" :field-style="placeholderStyle"></u-field>
		<u-field v-model="formattedEndTime" :border-bottom="false" :disabled="true" label="日期截止" input-align="right"
			:field-style="placeholderStyle"></u-field>
		<view style=" background-color:#EFEDE9;">
			<view class="pl-3 pr-2 font-14 lineHight-40 font-weight-bold">我的信息</view>
		</view>
		<u-field v-model="newlist.agricultureEnterpriseName" :border-bottom="false" :disabled="true" label="涉农企业"
			input-align="right" :field-style="placeholderStyle"></u-field>
		<u-field v-model="newlist.agriculturePhone" :border-bottom="false" :disabled="true" label="联系方式"
			input-align="right" :field-style="placeholderStyle"></u-field>
		<view style=" background-color:#EFEDE9;">
			<view class="pl-3 pr-2 font-14 lineHight-40 font-weight-bold">订单信息</view>
		</view>
		<!-- <u-field v-model="mobile" :border-bottom="false" :disabled="true" label-width="160" label="订单编号"
			input-align="right" :field-style="placeholderStyle"></u-field> -->

		<u-field v-model="formattedOrderTime" :border-bottom="false" :disabled="true" label="订单时间" input-align="right"
			:field-style="placeholderStyle"></u-field>
		<u-field v-model="newlist.orderSchedule" :border-bottom="false" :disabled="true" label-width="160" label="订单进度	"
			input-align="right" :field-style="placeholderStyle"></u-field>

		<u-field v-model="newlist.orderEvaluation" :border-bottom="false" :disabled="true" label="订单评价"
			input-align="right" :field-style="placeholderStyle"></u-field>

	</view>
</template>

<script>
	import $H from '@/common/free-lib/request.js';
	import freeListItem from "@/components/free-ui/free-list-item.vue";
	import ferrButton from "@/components/free-ui/ferr-button.vue";
	export default {
		components: {
			freeListItem,
			ferrButton,
		},
		data() {
			return {

				newlist: [],
				placeholderStyle: {
					color: '#999'
				},
				placeholderStyles: {
					color: '#FFC251'
				}
			}
		},
		onLoad(options) {
			const id = options.id;
			this.NewListDetail(id)
		},
		computed: {
			formattedOrderTime() {
			    if (!this.newlist.orderTime) return '';
			    return this.newlist.orderTime.split(' ')[0];
			},
			formattedEndTime() {
				if (!this.newlist.endTime) return '';
				return this.newlist.endTime.split(' ')[0];
			}
		},
		methods: {
			NewListDetail(id) {
				$H.get('/down/downServiceOrder/queryById', {
					id: id
				}, {}).then(res => {
					this.newlist = res.result
				}).catch(error => {
					uni.showToast({
						title: "网络错误，请稍后再试",
						icon: 'none'
					});
				});
			},

		}
	}
</script>

<style>
</style>